var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "date",
			name : "日期",
			renderData : function(rowindex,data, rowdata, column) {
				if(data!=''){
					return new Date(data).format("yyyy-MM-dd");
				}else{
					return "";
				}
			}
		}, {
			colkey : "materialCode",
			name : "物料编码"
		}, {
			colkey : "materialDescription",
			name : "物料描述"
		}, {
			colkey : "remark",
			name : "备注（预估开模完成日期）"
		}, {
			colkey : "registerCode",
			name : "注册模具编号"
		}, {
			colkey : "moldCavity",
			name : "模穴数"
		}, {
			colkey : "weight",
			name : "产品定重（克）"
		}, {
			colkey : "manufacturers",
			name : "制造厂家"
		}, {
			colkey : "returnDate",
			name : "回模日期"
		}, {
			colkey : "sampleDate",
			name : "送样日期"
		}, {
			colkey : "qualify",
			name : "合格情况"
		}, {
			colkey : "propertyRight",
			name : "模具产权"
		}],
		jsonUrl : rootPath + '/developProgress/developProgress_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑模具开发进度跟踪表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath + '/developProgress/developProgress_edit.shtml?id=' + cbox
	});
}




